

package com.zmks.jkgj.xuexiao.controller;




import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


import com.zmks.jkgj.core.controller.ABaseController;
import com.zmks.jkgj.core.resp.Resp;
import com.zmks.jkgj.xuexiao.SessionManager;
import com.zmks.jkgj.xuexiao.resp.WebResp;
import com.zmks.jkgj.xuexiao.service.ICrctBusiScoreItemService;
import com.zmks.jkgj.xuexiao.service.ICrctBusiSheetSchService;

import com.zmks.jkgj.xuexiao.vo.CrctBusiScoreItemVO;
import com.zmks.jkgj.xuexiao.vo.CrctBusiSheetSchVO;
import com.zmks.jkgj.xuexiao.vo.CrctObjClassVO;

@Controller
public class CrctBusiSheetSchController extends ABaseController {
	 @Autowired
		
		private ICrctBusiSheetSchService crctBusiSheetSchService;	
	 @Autowired
		
		private ICrctBusiScoreItemService crctBusiScoreItemService;	
	 //增加
		@RequestMapping("/save_crctBusiSheetSch")
		@ResponseBody
		public Resp save_crctBusiSheetSch(String name,String stu_num, String exam_date,
				String score_date,HttpServletRequest request) {
			
			
		WebResp 	webResp = new WebResp();
		CrctBusiSheetSchVO crctBusiSheetSchVO=new CrctBusiSheetSchVO();
		crctBusiSheetSchVO.setName(name);
		crctBusiSheetSchVO.setStu_num(stu_num);
		crctBusiSheetSchVO.setScore_date(new Date());
		crctBusiSheetSchVO.setCreate_date(new Date());
	  String  school_oid = SessionManager.getsession(request).getSchool_oid();
		crctBusiSheetSchVO.setSchool_oid(Long.parseLong(school_oid));
		crctBusiSheetSchService.save(crctBusiSheetSchVO);
			return webResp;
		}
	 //查询
	@RequestMapping("/get_CrctBusiSheetSch_list")
	@ResponseBody
	public Resp get_CrctBusiSheetSch_list( Integer pageIndex,
			Integer pageSize,HttpServletRequest request) {
		WebResp 	webResp = new WebResp();
		CrctBusiSheetSchVO crctBusiSheetSchVO=new  CrctBusiSheetSchVO();
		 String  school_oid = SessionManager.getsession(request).getSchool_oid();
		 crctBusiSheetSchVO.setSchool_oid(Long.parseLong(school_oid));
		webResp.setData(crctBusiSheetSchService.getList(crctBusiSheetSchVO));
		webResp.setTotalCount(crctBusiSheetSchService.getCount(crctBusiSheetSchVO));
	
		return webResp;
	}
	 //删除
	@RequestMapping("/remove_CrctBusiSheetSch")
	@ResponseBody
	public Resp remove_CrctBusiSheetSch(Long id,HttpServletRequest request) {
		WebResp 	webResp = new WebResp();

   //  CrctBusiSheetSchVO crctBusiSheetSchVO=new  CrctBusiSheetSchVO();
		CrctBusiScoreItemVO crctBusiScoreItemVO=new  CrctBusiScoreItemVO();
	    crctBusiScoreItemVO.setSheet_sch_oid(id);
	       crctBusiSheetSchService.remove(id);
	       crctBusiScoreItemService.remove(crctBusiScoreItemVO);
	      
           return webResp;
	}
	

}
